'''
filename: getData
author: yinwenlu
datetime: 2019/10/1 15:35
software: PyCharm
'''
from spider import ELESpider, MTSpider


def getOverData(shopInfo,type,beginData,endData):
    '''

    :param shopInfo:
    :param type:
    :return:
    '''
    result={}
    if type==1:
        mt=MTSpider(shopInfo.get("cookies"))
        mtFlow=mt.getTrendList(beginData,endData)
        return mtFlow
    else:
        ele = ELESpider(shopInfo.get("cookies"))
        eleFlow = ele.getOverViewSevice(beginData,endData)
        eleFlowTop=ele.getOverViewSeviceTop(beginData,endData)
        return {"eleFlow":eleFlow,"eleFlowTop":eleFlowTop}